<template>
  <div>
    <p >新闻展示:{{list.title}}-->{{list.content}}--总浏览数:{{list.total_views}}</p>
    <p v-for="i in list1">评论展示：{{i.content}}</p>
  </div>

</template>

<script>
    export default {
        name: "Show",
        data(){
          return{
            list:[],
            list1:[],
            uid:this.$route.params.id
          }
        },
        methods:{
          show_new(){
            axios({
            url:'http://127.0.0.1:8000/app01/shownews/'+this.uid,
            method:'get'
          }).then(res=>{
            console.log(res.data)
            this.list=res.data
          })
          },
          show_comment(){
            axios({
            url:'http://127.0.0.1:8000/app01/showcomment/'+this.uid,
            method:'get'
          }).then(res=>{
            console.log(res)
            this.list1=res.data
          })
          }
        },
        created() {
          this.show_comment()
          this.show_new()

        }
    }
</script>

<style scoped>

</style>